﻿@model LeadExpress.Models.ViewPages.UserManagementModel
           
@{
    ViewBag.Title = "Quản lý tài khoản";
    Layout = "~/Views/Shared/_Layout.Management.cshtml";
}

<h2 class="app">
	<strong>Express - Quản lý tài khoản</strong>
</h2>
<div class="title nomargin">
    <span class="right-btns">
        <input id="searchKeyword" type="text" class="text spl search filter" style="margin-top: -1px;" data-bind="value: Keywords, event: { keypress: RunSomethingKey }" />
        <a href="#" class="btn btn-go" data-bind="click: SearchButton">Go</a>
    </span>
	<h3>Xem tài khoản</h3>
</div>
<span class="paging">
    <span class="pageleft">                
        <span class="total" data-bind='text: PageText'></span>
        <span class="show">Hiển thị <input type="text" class="text" id="pagesize" data-bind='value: PageSize, attr: {maxlength: 3}, event: { keypress: RunSomethingKey }' /> trên trang <span class="smallText error-red" data-bind="text: PageSizeText"></span> </span>
    </span>
    <span class="pages">
        <span class="smallText error-red" data-bind="text: PageCurrentText"></span>Trang <input type="text" class="text" id="pagecurrent" data-bind='value: CurrentPageIndex, event: { keypress: RunSomethingKey }' /> của <span data-bind='text: MaxPageIndex' class="totalpages"></span>
        <a href="#" data-bind='click: PrevPage, attr: {class: PrevButtonClass}'>Prev </a>
  		<a href="#" data-bind='click: NextPage, attr: {class: NextButtonClass}'>Next </a>
    </span>
</span>

<div id="gridLead" class="table table-leads">
    <div id="progressbar"></div>
    <div class="title">
        <div class="col1" data-bind='click: function(event) { SetOrder(event, "Fullname")}'>
            <span class="w" style="height:22px">
                <a href="#">Tên</a>
                <div class="sort_wrapper" id="Fullname">  
                    <span class="grid_order ui_icon"></span>
                </div>                                        
            </span>                          
        </div>
		<div class="col1 col2" data-bind='click: function(event) { SetOrder(event, "Phone")}'>
            <span class="w" style="height:22px">
                <a href="#">Phone</a>
                <div class="sort_wrapper" id="Phone">  
                    <span class="grid_order ui_icon"></span>
                </div>              
            </span>
        </div>
		<div class="col1 col3" data-bind='click: function(event) { SetOrder(event, "Email")}'>
            <span class="w" style="height:22px">
                <a href="#">E-mail</a>
                <div class="sort_wrapper" id="Email">  
                    <span class="grid_order ui_icon"></span>
                </div>              
            </span>
        </div>
		<div class="col1 col4" data-bind='click: function(event) { SetOrder(event, "CreationDate")}'>
            <span class="w" style="height:22px">
                <a href="#">Ngày tạo</a>
                <div class="sort_wrapper" id="CreationDate">  
                    <span class="grid_order ui_icon desc"></span>
                </div>              
            </span>
        </div>
		<div class="col1 col5" data-bind='click: function(event) { SetOrder(event, "Address")}'>
            <span class="w" style="height:22px">
                <a href="#">Địa chỉ</a>
                <div class="sort_wrapper" id="Address">  
                    <span class="grid_order ui_icon"></span>
                </div>              
            </span>
        </div>

		<div class="col1 col6" data-bind='click: function(event) { SetOrder(event, "City")}'>
            <span class="w" style="height:22px">
                <a href="#">T.Phố</a>
                <div class="sort_wrapper" id="City">  
                    <span class="grid_order ui_icon"></span>
                </div>              
            </span>
        </div>
		<div class="col1 col7" data-bind='click: function(event) { SetOrder(event, "State")}'>
            <span class="w" style="height:22px">
                <a href="#">Tỉnh/Thành</a>
                <div class="sort_wrapper" id="State">  
                    <span class="grid_order ui_icon"></span>
                </div>              
            </span>
        </div>
		<div class="col1 col9" data-bind='click: function(event) { SetOrder(event, "IsLockedOut")}'>
            <span class="w" style="height:22px">
                <a href="#">Trạng thái</a>
                <div class="sort_wrapper" id="IsLockedOut">  
                    <span class="grid_order ui_icon"></span>
                </div>              
            </span>
        </div>
		<div class="col1 col11"><span class="w" style="height:22px">Lượt</span></div>
		<div class="col1 col12 centeralign"><span class="w" style="height:22px">Khóa</span></div>
    </div>
    <div class="linegroup" data-bind="foreach: Accounts">
        <div class="line" data-bind='css: {"line" : IsLockedOut===false, "line new": IsLockedOut!==false}'>                        
			<div class="col1"><span class="w" style="min-height: 24px;"><a class="preview" href="#userpreview" data-bind='text: Fullname, attr: { onclick: "OpenUserPreview(" + ID + ")"}'></a></span></div>
			<div class="col1 col2"><span class="w" style="min-height: 24px;"><a data-bind="text: Phone" class="button"></a></span></div>
			<div class="col1 col3"><span class="w" style="min-height: 24px;"><a data-bind='text: Email, attr: {href: "mailto:" + Email}'></a></span></div>
			<div class="col1 col4"><span class="w" style="min-height: 24px;" data-bind='text: CreationDate'></span></div>
			<div class="col1 col5"><span class="w" style="min-height: 24px;" data-bind='text: Address'></span></div>
			<div class="col1 col6"><span class="w" style="min-height: 24px;"><a data-bind='text: City'></a></span></div>
			<div class="col1 col7"><span class="w" style="min-height: 24px;" data-bind='text: State'></span></div>
			<div class="col1 col9"><span class="w" style="min-height: 24px;"><span class="green" data-bind='text: Status, attr: {id: "status" + ID}'></span></span></div>			
			<div class="col1 col11">
                <span class="w" style="min-height: 24px;" data-bind='text: NumLogin' ></span>                                
            </div>
			<div class="col1 col12 centeralign"><span class="w" style="min-height: 24px;"><a class="btn btn-x locked" data-bind='attr: {href: "#cfmLocked", id: "account" + ID, rel: Fullname, onclick: "OpenAccount(" + ID + ")"}'>Locked</a></span></div>
        </div>
    </div>
</div>         
@Html.Partial("_PopupConfirmLocked")   
@Html.Partial("_PartialUserPreview")

<script type="text/javascript">
    var data = @(Html.Raw(Json.Encode(Model)));
</script>
<script src="/Scripts/viewModel/accountgrid.js" type="text/javascript"></script> 